﻿@{
    ViewBag.Title = "r3form1";

    Layout = "~/Views/Shared/_LayoutReport.cshtml";
}

    <script language="javascript">

        $(document).ready(function () {

            $("#dtAsOf").val('@ViewBag.asOf');


            $(function () {
                $("#dateAsOf").datepicker({ dateFormat: 'dd/mm/yy' });
            });



            $.ajax({
                url: '@Url.Action("GetCompanyType", "Master" ,new { type = @ViewBag.mode })',
                type: 'POST',
                dataType: 'json',
                data: {},
                success:
                            function (data) {
                                var jsonobj = eval('(' + data + ')');
                                var select = $("#SelectCompany");


                                $.each(jsonobj, function (index, itemData) {

                                    select.append($('<option/>', {
                                        value: itemData.key,
                                        text: itemData.val
                                    }));
                                });
                                $("#SelectCompany").val('@ViewBag.company');
                            }
            });

            $.ajax({
                url: '@Url.Action("GetYears", "Master")',
                type: 'POST',
                dataType: 'json',
                data: {},
                success:
                            function (data) {
                                var jsonobj = eval('(' + data + ')');
                                var select = $("#selectYear");


                                $.each(jsonobj, function (index, itemData) {

                                    select.append($('<option/>', {
                                        value: itemData.key,
                                        text: itemData.val
                                    }));
                                });
                                $("#selectYear").val('@ViewBag.year');
                            }
            });

            

        });
        function exportReport() {
            $("#formReport").submit();
        }
</script>

    <h2></h2>
 
    <table width="880"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
        <tr>
          <td height="39" align="center">@ViewBag.reportCode : @ViewBag.reportName</td>
        </tr>
      </table>
 
    <p>
      <table width="900" border="0" align="center">
        <tr>
          <td>
              @using (Html.BeginForm("Export", "ReportR3", FormMethod.Post ,new { id = "formReport" }))
{
                  <input type="hidden" value="@ViewBag.reportCode" name="reportCode" id="reportCode" />
		      <table width="95%"  border="0" align="center" cellspacing="2">
                <tr>
                  <td width="200"><div align="right">Company: </div></td>
                  <td width="10">&nbsp;</td>
                  <td width="621"><select name="SelectCompany" id="SelectCompany">
                    <option value="0">--Select data--</option>
               </td>
                </tr>
				  <tr>
                  <td><div align="right">Year : </div></td>
                  <td>&nbsp;</td>
                  <td><select name="selectYear" id="selectYear">
                    <option value="">--Select data--</option>    
                  </select></td>
                </tr>
                <tr>
                  <td><div align="right">As of  : </div></td>
                  <td>&nbsp;</td>
                  <td><input name="dateAsOf" type="text" id="dateAsOf" style="text-align:center " value="" size="10" >
                   </td>
                </tr>
 
                <tr>
                  <td><div align="right"></div></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
              </table>
		      <table width="95%"  border="0" align="center">
                <tr>
                  <td><div align="center"><a href="#" onclick="exportReport()">
                      <img src="../../Content/images/27-1-2557 19-10-26.jpg" width="240" height="70" border="0" usemap="#Map"
                          
                          ></a>

                      </div></td>
                </tr>
              </table>
              }
		    <br></td>
        </tr>
    </table>
    </p>
 
